package leetcode.数组;

public class 移除元素27 {
    public int removeElement(int[] nums, int val) {
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            if(nums[i] != val){
                nums[res] = nums[i];
                res++;
            }
        }
        return res;

    }
}
